﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.ObjectModel;


namespace SignalLab
{
  public class MainViewModel : ViewModelBase
  {
    public string PageName
    {
      get
      {
        return "Main page";
      }
    }

    public MainViewModel()
    {
      this.QuickMenu = new ObservableCollection<ItemViewModel>();
      this.Items = new ObservableCollection<ItemViewModel>();
      this.Settings = new ObservableCollection<SettingItemViewModel>();
    }

    /// <summary>
    /// A collection for ItemViewModel objects.
    /// </summary>
    public ObservableCollection<ItemViewModel> Items { get; private set; }

    public ObservableCollection<ItemViewModel> QuickMenu { get; private set; }

    public ObservableCollection<SettingItemViewModel> Settings { get; private set; }


    public bool IsDataLoaded
    {
      get;
      private set;
    }

    /// <summary>
    /// Creates and adds a few ItemViewModel objects into the Items collection.
    /// </summary>
    public void LoadData()
    {
      // Sample data; replace with real data
      this.QuickMenu.Add(new ItemViewModel() { LineOne = "By category", LineTwo = "/Records.xaml"});
      this.QuickMenu.Add(new ItemViewModel() { LineOne = "By date", LineTwo = "/Records.xaml" });
      this.QuickMenu.Add(new ItemViewModel() { LineOne = "By signal type", LineTwo = "/Records.xaml" });


      this.Items.Add(new ItemViewModel() { LineOne = "ECG", LineTwo = "Electrocardiogram ", LineThree = "Accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat" });
      this.Items.Add(new ItemViewModel() { LineOne = "BPM", LineTwo = "Beats per second in sound wave", LineThree = "Pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum" });
      this.Items.Add(new ItemViewModel() { LineOne = "GSR", LineTwo = "Galvanic skin response ", LineThree = "Pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum" });

      this.Settings.Add(SettingsManager.Categories);
      this.Settings.Add(SettingsManager.Account);
      this.Settings.Add(new SettingItemViewModel() { SettingName = "About" });

      this.IsDataLoaded = true;
    }

  }
}